/*
 * @Author: 耿远风
 * @Date: 2020-10-16 15:22:39
 * @LastEditors: 耿远风
 * @LastEditTime: 2020-10-16 18:05:29
 * @Description: 
 */
import { LunBo } from './lunbo.entity';
import { Injectable } from '@nestjs/common';
import { LockService } from './../../base/services/lock.service';
@Injectable()
export class LunBoService {
  constructor(private readonly lockService: LockService) {}
  async lunboList({pageNum=0,pageSize=15}){
    return await LunBo.ybFind({}).sort('-createdAt').limit(pageSize).skip(pageSize * pageNum);
  }
  async addNew({title,cover,type}){
    return await new LunBo({title,cover,type}).save;
  }
}
